

package com.hazelcast.auditlog;

import java.util.Map;

/**
 * Observable event in the system.
 */
public interface AuditableEvent {

    /**
     * @return Unique event type code. Must not be {@code null}.
     */
    String typeId();

    /**
     * Return a text description of the event.
     * <p>
     * <strong>Warning:</strong> Hazelcast doesn't guarantee content of the message. The value can change between versions.
     *
     * @return Event message
     */
    String message();

    /**
     * Return Map of parameters for given event.
     * <p>
     * <strong>Warning:</strong> Hazelcast doesn't guarantee content of the parameters Map (parameters, names, values
     * or types used). The value can change between versions.
     *
     * @return Event parameters. Must not be {@code null}.
     */
    Map<String, Object> parameters();

    /**
     * @return Importance level.  Must not be {@code null}.
     */
    Level level();

    /**
     * Return an exception or error (if any) which caused this event.
     *
     * @return event cause or {@code null}
     */
    Throwable cause();

    /**
     * Returns event timestamp as milliseconds from the epoch.
     *
     * @return event timestamp in millis
     */
    long getTimestamp();
}
